package IO;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.StandardCharsets;

/*

 */
public class OSWDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("osw.txt");
//        fos.write("生如蝼蚁当有鸿鹄之志，为天地立心，为生民立命，为往圣继绝学，为万世开太平".getBytes(StandardCharsets.UTF_8));
//        fos.write("天地不仁以万物为刍狗".getBytes(StandardCharsets.UTF_8));

        OutputStreamWriter osw = new OutputStreamWriter(fos,StandardCharsets.UTF_8);
        osw.write("为天地立心，为生民立命，为往圣继绝学，为万世开太平");
        osw.write("\n"+"全心全意为人民服务");

        System.out.println("写完了");
        osw.close();
    }
}
